home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Games / xpipeman / info.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-03  |  8.3 KB  |  251 lines

  1. /*
  2.  * help.c  - Xpipeman
  3.  *
  4.  * Send Constructive comments, bug reports, etc. to either
  5.  *
  6.  *          JANET: pavern@uk.ac.man.cs
  7.  *
  8.  *  or      INER : pavern%cs.man.ac.uk@nsfnet-relay.ac.uk
  9.  *
  10.  * All other comments > /dev/null !!
  11.  * 
  12.  * Copyright 1991 Nigel Paver
  13.  * 
  14.  * Permission to use, copy, modify, distribute, and sell this software and its
  15.  * documentation for any purpose is hereby granted without fee, provided that
  16.  * the above copyright notice appear in all copies and that both that
  17.  * copyright notice and this permission notice appear in supporting
  18.  * documentation, and that the author's name not be used in advertising or
  19.  * publicity pertaining to distribution of the software without specific,
  20.  * written prior permission.  The author makes no representations about the
  21.  * suitability of this software for any purpose.  It is provided "as is"
  22.  * without express or implied warranty.
  23.  * 
  24.  * THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 
  25.  * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE 
  26.  * AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY 
  27.  * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 
  28.  * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 
  29.  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  30.  * 
  31.  */
  32.  
  33. #include <X11/Intrinsic.h>
  34. #include <X11/StringDefs.h>
  35. #include <X11/Shell.h>
  36.  
  37. #ifdef R3
  38. #include <X11/Box.h>
  39. #include <X11/Command.h>
  40. #include <X11/Label.h>
  41. #else
  42. #include <X11/Xaw/Box.h>
  43. #include <X11/Xaw/Command.h>
  44. #include <X11/Xaw/Label.h>
  45. #endif
  46.  
  47. #include "xpipeman.h"
  48.  
  49.  
  50.  
  51. Widget info_popup;
  52.  
  53. /*ARGSUSED*/
  54. static XtCallbackProc 
  55. info_popdown_callback(w, closure, call_data)
  56.   Widget w;
  57.   caddr_t closure;
  58.   caddr_t call_data;
  59. {
  60.   XtPopdown(info_popup);
  61. }
  62.  
  63. /*XtCallbackProc*/
  64. void
  65. show_info()
  66. {
  67.   XtPopup(info_popup, XtGrabNone);
  68. }
  69.  
  70. static Arg arglist_info_title[] = {
  71.   {  XtNborderWidth, (XtArgVal) 0  },
  72.   {  XtNresize, (XtArgVal) False  },
  73.   {  XtNwidth, (XtArgVal) 320   },
  74.   {  XtNheight, (XtArgVal) 50   },
  75.   {  XtNlabel, (XtArgVal) "Xpipeman 1.3"  },
  76.   {  XtNjustify, (XtArgVal) XtJustifyCenter  },
  77. };
  78.  
  79. static Arg arglist_copyright_label[] = {
  80.   {  XtNborderWidth, (XtArgVal) 0  },
  81.   {  XtNresize, (XtArgVal) False  },
  82.   {  XtNwidth, (XtArgVal) 320   },
  83.   {  XtNlabel, (XtArgVal) "Written by Nigel Paver 1991"  },
  84.   {  XtNjustify, (XtArgVal) XtJustifyCenter  },
  85. };
  86.  
  87. static Arg arglist_author_label1[] = {
  88.   {  XtNborderWidth, (XtArgVal) 0  },
  89.   {  XtNresize, (XtArgVal) False  },
  90.   {  XtNwidth, (XtArgVal) 320   },
  91.   {  XtNlabel, (XtArgVal) "Current Address"  },
  92.   {  XtNjustify, (XtArgVal) XtJustifyCenter  },
  93. };
  94.  
  95. static Arg arglist_author_label2[] = {
  96.   {  XtNborderWidth, (XtArgVal) 0  },
  97.   {  XtNresize, (XtArgVal) False  },
  98.   {  XtNwidth, (XtArgVal) 320   },
  99.   {  XtNlabel, (XtArgVal) "Dept. Computer Science"  },
  100.   {  XtNjustify, (XtArgVal) XtJustifyCenter  },
  101. };
  102.  
  103. static Arg arglist_author_label3[] = {
  104.   {  XtNborderWidth, (XtArgVal) 0  },
  105.   {  XtNresize, (XtArgVal) False  },
  106.   {  XtNwidth, (XtArgVal) 320   },
  107.   {  XtNlabel, (XtArgVal) "Manchester University"  },
  108.   {  XtNjustify, (XtArgVal) XtJustifyCenter  },
  109. };
  110.  
  111. static Arg arglist_author_label4[] = {
  112.   {  XtNborderWidth, (XtArgVal) 0  },
  113.   {  XtNresize, (XtArgVal) False  },
  114.   {  XtNwidth, (XtArgVal) 320   },
  115.   {  XtNlabel, (XtArgVal) "ENGLAND M13 9PL"  },
  116.   {  XtNjustify, (XtArgVal) XtJustifyCenter  },
  117. };
  118.  
  119. static Arg arglist_author_label5[] = {
  120.   {  XtNborderWidth, (XtArgVal) 0  },
  121.   {  XtNresize, (XtArgVal) False  },
  122.   {  XtNwidth, (XtArgVal) 320   },
  123.   {  XtNlabel, (XtArgVal) "Janet: pavern@uk.ac.man.cs"  },
  124.   {  XtNjustify, (XtArgVal) XtJustifyCenter  },
  125. };
  126.  
  127. static Arg arglist_author_label6[] = {
  128.   {  XtNborderWidth, (XtArgVal) 0  },
  129.   {  XtNresize, (XtArgVal) False  },
  130.   {  XtNwidth, (XtArgVal) 320   },
  131.   {  XtNlabel, (XtArgVal) "Inet: pavern%uk.ac.man.cs@nsfnet-relay.ac.uk"  },
  132.   {  XtNjustify, (XtArgVal) XtJustifyCenter  },
  133. };
  134.  
  135. static Arg arglist_blank_label[] = {
  136.   {  XtNborderWidth, (XtArgVal) 0  },
  137.   {  XtNresize, (XtArgVal) False  },
  138.   {  XtNwidth, (XtArgVal) 320   },
  139.   {  XtNlabel, (XtArgVal) "  "  },
  140.   {  XtNjustify, (XtArgVal) XtJustifyCenter  },
  141. };
  142.  
  143. static Arg arglist_info_popdown[] = {
  144.   {  XtNborderWidth, (XtArgVal) 2  },
  145.   {  XtNresize, (XtArgVal) False  },
  146.   {  XtNwidth, (XtArgVal) 320   },
  147.   {  XtNlabel, (XtArgVal) "Cancel"  },
  148.   {  XtNjustify, (XtArgVal) XtJustifyCenter  },
  149. };
  150.  
  151.  
  152. void
  153. create_info_popup(parent)
  154.   Widget parent;
  155. {
  156.   int i;
  157.   Widget info_msg, info_popdown,info_box;
  158.   Arg wargs[1];
  159.   char *message;
  160.   
  161.   info_popup = XtCreatePopupShell(
  162.                                    "info_popup",
  163.                                    transientShellWidgetClass,
  164.                                    parent, 0,0);
  165.  
  166.   info_box = XtCreateManagedWidget(
  167.                                     "info_box",
  168.                                     boxWidgetClass,
  169.                                     info_popup,
  170.                                     0,0);
  171.  
  172.    (void)XtCreateManagedWidget(
  173.                                     "info_title",
  174.                                     labelWidgetClass,
  175.                                     info_box,
  176.                                     arglist_info_title,
  177.                                     XtNumber(arglist_info_title));
  178.  
  179.    (void)XtCreateManagedWidget(
  180.                                     "copyright_dec",
  181.                                     labelWidgetClass,
  182.                                     info_box,
  183.                                     arglist_copyright_label,
  184.                                     XtNumber(arglist_copyright_label));
  185.  
  186.    (void)XtCreateManagedWidget(
  187.                                     "blank",
  188.                                     labelWidgetClass,
  189.                                     info_box,
  190.                                     arglist_blank_label,
  191.                                     XtNumber(arglist_blank_label));
  192.  
  193.    (void)XtCreateManagedWidget(
  194.                                     "author1",
  195.                                     labelWidgetClass,
  196.                                     info_box,
  197.                                     arglist_author_label1,
  198.                                     XtNumber(arglist_author_label1));
  199.  
  200.    (void)XtCreateManagedWidget(
  201.                                     "author2",
  202.                                     labelWidgetClass,
  203.                                     info_box,
  204.                                     arglist_author_label2,
  205.                                     XtNumber(arglist_author_label2));
  206.    (void)XtCreateManagedWidget(
  207.                                     "author3",
  208.                                     labelWidgetClass,
  209.                                     info_box,
  210.                                     arglist_author_label3,
  211.                                     XtNumber(arglist_author_label3));
  212.    (void)XtCreateManagedWidget(
  213.                                     "author4",
  214.                                     labelWidgetClass,
  215.                                     info_box,
  216.                                     arglist_author_label4,
  217.                                     XtNumber(arglist_author_label4));
  218.    (void)XtCreateManagedWidget(
  219.                                     "author5",
  220.                                     labelWidgetClass,
  221.                                     info_box,
  222.                                     arglist_author_label5,
  223.                                     XtNumber(arglist_author_label5));
  224.    (void)XtCreateManagedWidget(
  225.                                     "author6",
  226.                                     labelWidgetClass,
  227.                                     info_box,
  228.                                     arglist_author_label6,
  229.                                     XtNumber(arglist_author_label6));
  230.  
  231.  
  232.    (void)XtCreateManagedWidget(
  233.                                     "blank",
  234.                                     labelWidgetClass,
  235.                                     info_box,
  236.                                     arglist_blank_label,
  237.                                     XtNumber(arglist_blank_label));
  238.  
  239.  info_popdown = XtCreateManagedWidget(
  240.                                     "info_popdown",
  241.                                     commandWidgetClass,
  242.                                     info_box,
  243.                                     arglist_info_popdown,
  244.                                     XtNumber(arglist_info_popdown));
  245.  
  246.  
  247.   XtAddCallback(info_popdown,XtNcallback,info_popdown_callback,0);
  248.  
  249. }
  250.  
  251.